<template>
	<view class="check-true-false-panel" @click.native.stop="changeCheck">
		<uni-icons v-if="formValue === '0'" type="closeempty" size="16" color="#F43F3B"></uni-icons>
		<uni-icons v-else-if="formValue === '1'" type="checkmarkempty" size="16" color="#09BB07"></uni-icons>
		<!-- <text v-else>请选择</text> -->
	</view>
</template>

<script>
	import uniIcons from "@/components/uni-icons/uni-icons.vue"
	
	export default {
		components: {uniIcons},
		props:{
			formValue: {
				type: String,
				default: null
			},
			formKey:{
				type: Number,
				default: null
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			changeCheck(){
				// console.log(this.formValue)
				if(this.formValue === null || this.formValue === ''){
					this.$emit('input', this.formKey, '0')
				}else if(this.formValue === '0'){
					this.$emit('input', this.formKey, '1')
				}else if(this.formValue === '1'){
					this.$emit('input', this.formKey, null)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.check-true-false-panel{
		flex: 1;
		height: 56upx;
		width: 100%;
	}
</style>
